package com.xyx.bloodoxygenlib.impls;

import com.xyx.bloodoxygenlib.interfaces.IReader;
import com.xyx.bloodoxygenlib.utils.BLEHelper;

import java.io.IOException;

public class ReaderBLE implements IReader {
    private BLEHelper mHelper;

    public ReaderBLE(BLEHelper helper) {
        this.mHelper = helper;
    }

    @Override // com.creative.base.Ireader
    public int read(byte[] buffer) throws IOException {
        return this.mHelper.read(buffer);
    }

    @Override // com.creative.base.Ireader
    public void close() {
        this.mHelper = null;
    }

    @Override // com.creative.base.Ireader
    public void clean() {
        this.mHelper.clean();
    }

    @Override // com.creative.base.Ireader
    public int available() throws IOException {
        if (this.mHelper != null) {
            return this.mHelper.available();
        }
        return 0;
    }
}
